#!/usr/bin/perl # for syntax highlighting

use gri_secmgr qw(redirect_header);
use MIME::Base64;

sub mm_menu_portal_or_section_chooser($$) {
my $portal=shift;
my $section=shift;

	my $url_prefix=$::GRI_FRONTEND->get_url_prefix();
	if($portal ne "__NONE__") {
		my $link="$url_prefix$::ENV{SCRIPT_NAME}/portal_tl?portal=$portal";
		redirect_header(path => $link);
		exit(0);
	}
	if($section ne "__NONE__") {
		my $x=hex_to_string($section);
		my $snam=encode_base64($x); $snam =~ s/\n//g;
		my $link="$url_prefix$::ENV{SCRIPT_NAME}/docrepos_show_section_docs?section=$snam,page=1";
		redirect_header(path => $link);
		exit(0);
	}

	# Nothing selected, so return to top-level page
	my $link="$url_prefix$::ENV{SCRIPT_NAME}";
	redirect_header(path => $link);
	exit(0);
}

# vim: ts=4:sw=4
